# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-parsel
pkgver=1.7.0
pkgrel=2
pkgdesc="Parsel is a library to extract data from HTML and XML using XPath and CSS selectors"
arch=('any')
license=('BSD')
url="https://github.com/scrapy/parsel"
depends=('python-cssselect' 'python-lxml' 'python-setuptools' 'python-six' 'python-w3lib')
makedepends=('python-pytest-runner')
checkdepends=('python-sybil' 'python-psutil')
source=("$pkgname-$pkgver.tar.gz::https://github.com/scrapy/parsel/archive/v$pkgver.tar.gz")
sha512sums=('669dc5a25f488dbf789ecc4b3e055488ac8040427375b359ddfe48b676c5ebdee6408f4baa0adbb507f6b86d5659f947f2907b63b5bb029e8bea3ac0c40f9b6d')

build() {
  cd parsel-$pkgver
  python setup.py build
}

check() {
  cd parsel-$pkgver
  python -m pytest
}

package() {
  cd parsel-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
